package cn.edu.cug.cs.gtl.apis.render.meshes;

import cn.edu.cug.cs.gtl.apis.render.NativeObjectWrapper;
import cn.edu.cug.cs.gtl.apis.render.basics.Box3f;
import cn.edu.cug.cs.gtl.apis.render.basics.Vec3f;

public interface Cell extends NativeObjectWrapper {

    /**
     * Gets the area of a cell.
     * @return
     */
    float	getArea();

    /**
     * Gets the cell's bounding box.
     * @return
     */
    Box3f getBoundingBox();

    /**
     * Gets the cell's bounding box.
     * @return
     */
    float[]	getBounds();
    //Gets the cell's bounds.

    /**
     *
     * Gets the cell's geometric center.
     * @return
     */
    Vec3f getCenter();

    /**
     *
     *Gets the index of the cell in the mesh.
     * @return
     */
    int	getIndex();

    /**
     * Gets the length of the longest edge of the cell.
     * @return
     */
    float	getLongestEdgeLength();

    /**
     * Gets the coordinate of the nod (nod must be >=0 and < getNumNodes()).
     * @param nod
     * @return
     */
    Vec3f	getNodeCoord(int nod);

    /**
     * Gets the index (in the mesh) of a nod (nod must be >=0 and < getNumNodes()).
     * @param nod
     * @return
     */
    int	getNodeIndex(int nod);

    /**
     * Gets the number of edges.
     * @return
     */
    int	getNumEdges();

    /**
     * Gets the number of facets.
     * @return
     */
    int	getNumFacets();

    /**
     * Gets the number of nodes.
     * @return
     */
    int	getNumNodes();

    /**
     * Gets the scalar value of a point in this cell, given the point's weights.
     * @param weight
     * @param s
     * @return
     */
    float	getValue(float[] weight, float[] s);

    /**
     * Gets the vector value of a point in this cell, given the point's weights.
     * @param weight
     * @param v
     * @return
     */
    Vec3f	getValue(float[] weight, Vec3f[] v);

    /**
     * Get the scalar value of a point in the cell.
     * @param pcoord
     * @param s
     * @return
     */
    float	getValue(Vec3f pcoord, float[] s);

    /**
     * Get the vector value of a point in the cell.
     * @param pcoord
     * @param v
     * @return
     */
    Vec3f	getValue(Vec3f pcoord, Vec3f[] v);

    /**
     * Gets the volume of the cell.
     * @return
     */
    float	getVolume();

    /**
     * Returns 1 if the point is inside the cell, 0 otherwise.
     * @param coord
     * @param tolerance
     * @return
     */
    Vec3f	locatePoint(Vec3f coord, float tolerance);


}
